package com.tanhua.server.controller;

import com.tanhua.server.service.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @auther : 白月尘
 * @date : 10:09  2021/10/24
 */
@RestController
@RequestMapping("/baidu")
public class BaiduController {
    @Autowired
    private BaiduService baiduService;


    @PostMapping("/location")
    public ResponseEntity location(@RequestBody Map map) {
        double latitude = Double.parseDouble(map.get("latitude").toString());//纬度
        double longitude = Double.parseDouble(map.get("longitude").toString());//经度
        String addrStr = map.get("addrStr").toString();
        baiduService.location(latitude,longitude,addrStr);
        return ResponseEntity.ok(null);
    }
}
